﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;

//------------------------------------------------------------
// shaco Framework
// Copyright © 2017-2021 chang.liu All rights reserved.
// Feedback: 449612236@qq.com
//------------------------------------------------------------

namespace shaco
{
    public class DelayTime : ActionBase
    {
        static public DelayTime Create(float duration)
        {
            var ret = shaco.GameHelper.objectpool.Instantiate(() => new DelayTime());
            ret.duration = duration;

            return ret;
        }

        public override void OnReset()
        {
            base.OnReset();
            if (shaco.GameHelper.objectpool.IsInstantiated(this))
                this.RecyclingWithPool();
        }

        public override ActionBase Reverse(GameObject target)
        {
            return DelayTime.Create(duration);
        }

        public override ActionBase Clone()
        {
            return DelayTime.Create(duration);
        }

        private DelayTime() { }
    }
}